import base from "./base"; // 导入接口域名列表
import axios from "../http"; // 导入http中创建的axios实例
import qs from "qs"; // 根据需求是否导入qs模块

const getEstate = {
  getEstateCateTreeList(params) {
    return axios.post(
      `${base.bd}/admin/estate_cate/lists_tree`,
      qs.stringify(params)
    );
  },
  addProductCat(params) {
    return axios.post(
      `${base.bd}/admin/estate_cate/saveadd`,
      qs.stringify(params)
    );
  },
  delProductCat(params) {
    return axios.post(`${base.bd}/admin/estate_cate/del`, qs.stringify(params));
  },
  updateProductCat(params) {
    return axios.post(
      `${base.bd}/admin/estate_cate/saveedit`,
      qs.stringify(params)
    );
  },
  findProduct(params) {
    return axios.post(`${base.bd}/admin/estate_cate/edit`, qs.stringify(params));
  },
  sortProductCat(params) {
    return axios.post(
      `${base.bd}/admin/estate_cate/menu_sort`,
      qs.stringify(params)
    );
  },

  sortInputCat(params) {
    return axios.post(
      `${base.bd}/admin/estate_cate/sort_by_number`,
      qs.stringify(params)
    );
  },
  get_lists_son(params) {
    return axios.post(
      `${base.bd}/admin/estate_cate/lists_son`,
      qs.stringify(params)
    );
  },
  //房产首页
  getEstateIndex(params){
    return axios.post(
      `${base.bd}/admin/estate_page/index`,
      qs.stringify(params)
    );
  },
  addEstateIndex(params){
    return axios.post(
      `${base.bd}/admin/estate_page/saveedit`,
      qs.stringify(params)
    );
  },
  addEstateIndexNews(params){
    return axios.post(
      `${base.bd}/admin/estate_page/add_news`,
      qs.stringify(params)
    );
  },
  delEstateIndexNews(params){
    return axios.post(
      `${base.bd}/admin/estate_page/del_news`,
      qs.stringify(params)
    );
  },
  addEstateIndexEstate(params){
    return axios.post(
      `${base.bd}/admin/estate_page/add_estate`,
      qs.stringify(params)
    );
  },
  delEstateIndexEstate(params){
    return axios.post(
      `${base.bd}/admin/estate_page/del_estate`,
      qs.stringify(params)
    );
  },
  getEstateLists(params){
    return axios.post(
      `${base.bd}/admin/estate/lists`,
      qs.stringify(params)
    );
  },
  addEstate(params){
    return axios.post(
      `${base.bd}/admin/estate/saveadd`,
      qs.stringify(params)
    );
  },
  editEstate(params){
    return axios.post(
      `${base.bd}/admin/estate/edit`,
      qs.stringify(params)
    );
  },
  saveEditEstate(params){
    return axios.post(
      `${base.bd}/admin/estate/saveedit`,
      qs.stringify(params)
    );
  },
  copyEstate(params){
    return axios.post(
      `${base.bd}/admin/estate/copy_estate`,
      qs.stringify(params)
    );
  },
  delEstate(params){
    return axios.post(
      `${base.bd}/admin/estate/del`,
      qs.stringify(params)
    );
  },
  delAllEstate(params){
    return axios.post(
      `${base.bd}/admin/estate/del_all`,
      qs.stringify(params)
    );
  },
  checkShowEstate(params){
    return axios.post(
      `${base.bd}/admin/estate/show_change`,
      qs.stringify(params)
    );
  },
  sortEstate(params){
    return axios.post(
      `${base.bd}/admin/estate_page/estate_home_sort`,
      qs.stringify(params)
    );
  },
  sortEstateNews(params){
    return axios.post(
      `${base.bd}/admin/estate_page/news_home_sort`,
      qs.stringify(params)
    );
  }
};
export default getEstate;
